< previous page page_587 next page >

Page 587
9f31265bb40b592b1929e18a47ab28e5.gif
   '***************************************
   '* Alternate Method
   '***************************************
   'With oIni
   '   .KeySave txtKeyValue, _
   '           txtSection, _
   '           txtKeyName
   'End With

   Set oIni = Nothing
End Sub
Notice that at the end of this routine I have commented out an alternate way to store data by passing all the relevant information directly to the KeySave() method.
Using the INI Class to Save Many Values
If you click the Save Many Values command button, youll save many hard-coded values to the INI file under the section specified in the Section text box. Heres the code:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdSaveMany_Click()
   Dim oIni As INI

   Set oIni = New INI
   With oIni
      .ConfigName = Trim$(txtConfig)
      .Section = Trim$(txtSection)
      .KeySave strKeyValue:="Employee.mdb", _
              strKeyName:="File"
      .KeySave strKeyValue:="-1", _
              strKeyName:="JetMDB"
      .KeySave strKeyValue:="0", _
              strKeyName:="OnServer"
      .KeySave strKeyValue:="1.1.1", _
              strKeyName:="Version"
   End With

   Set oIni = Nothing
End Sub

 
< previous page page_587 next page >

If you like this book, buy it!